/*
编写一个循环，对console.log进行7次调用以输出以下三角形
打印如下图形
#
##
###
####
#####
######
#######
*/
// console.log(process.argv)
// 读取命令行输入
const readline = require('readline');
 
function readSyncByRl(tips) {
    tips = tips || '> ';
 
    return new Promise((resolve) => {
        const rl = readline.createInterface({
            input: process.stdin,
            output: process.stdout
        });
 
        rl.question(tips, (answer) => {
            rl.close();
            resolve(answer.trim());
        });
    });
}
 // 读取命令行输入数字，输出#
readSyncByRl('请输入任意数字：').then((res) => {
    if(isNaN(res)) {
        console.log('输入错误！！')
    }else {
        print(res)
    }
});

function print(num){
    for(let i=0; i<=num; i++) {
        let str = ''
        for(let j=0; j<=i; j++) {
            str += '#'
        }
        console.log(str)
    }
}